Image processor

ABSTRACT

In a digital copying machine, a ground in a document image is removed according to the type of document by referring to a histogram of reflectance data on a document image prepared for each line. A ground peak or a gradation level having the largest frequency in the histogram is determined. Further, frequencies are obtained in three windows appropriate for extracting characteristic quantities for ground, background and characters. A window for the ground quantity is determined according to the ground peak, and a ground range for removing the ground is determined by using the ground peak and the three frequencies. Then, the gradation data are corrected according to the ground range, and an image is formed on a sheet of paper according to the corrected gradation data. Thus, a ground can be removed by analyzing the histogram without a prescan.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to a digital image processor for a digitalcopying machine or the like, especially to processing of ground andbackground of a document image.

2. Description of the Prior Art

In an analog electrophotographic copying machine or the like, a quantityof exposure light is controlled automatically by monitoring an averagedensity of a document image. Thus, a ground of a document image can beremoved by changing the quantity of exposure light. A ground means anarea, such as a white base area in a white paper, wherein no informationis recorded. This automatic exposure control has an advantage that itcan be performed at a high speed. It is also advantageous that theautomatic exposure can be controlled rather uniformly when it isrepeated on the same document.

On the other hand, in a digital electrophotographic copying machine orthe like, a document image is first read as digital data and the digitaldata is printed. In such a digital copying machine, various dataprocessing is possible if prescan data is available. Then,characteristics of a reproduced image can be controlled or changed byusing data processing on the prescan data. For example, it is possibleto discriminate a type of document such as a half-tone documentincluding a photograph or the like or a character document includingonly characters and to correct the digital data according to the type ofdocument, for example with smoothing or edge emphasis.

One of the data processing methods includes removing a ground of adocument image by setting an appropriate ground range which includes thedensity level of the ground. Then, the image density can be correctedfor example by removing the data in the ground range. The ground rangecan be determined, for example, by analyzing a shape of an entirehistogram of image data or by using a level having a maximum frequencyin the histogram. Then, the ground can be corrected appropriately byanalyzing image data.

However, such digital data processing has disadvantages if compared withan analog copying machine. For example, a high speed processing isdifficult due to data processing by a software program. It is alsodisadvantageous that prescan data is needed.

SUMMARY OF THE INVENTION

An object of the present invention is to provide an image processorwhich can remove a ground from an image at a fast speed.

Another object of the present invention is to provide an image processorwhich can remove a ground from an image according to various kinds ofdocuments.

In one aspect of the invention, a histogram is prepared by countingfrequencies at each gradation level on the digital image data. Then, agradation level having the largest frequency in the histogram isextracted as a ground reference value. Further, a feature of a documentimage useful for handling a ground and a background is extracted fromthe histogram. The ground means an area, such as a white base area in awhite paper, wherein no information is recorded. The background means anarea lying behind chief objects to be reproduced or a less importantpart of a document against the chief objects. Thus, a ground range isset according to the ground reference value by using a prescribedrelation. Thus, image data are corrected by using the ground range andthe feature. A histogram is prepared for each of a plurality of regionsin a document, or more preferably for each line. Thus, the groundcorrection can be performed without prescan data of image data.Preferably if a change in a ground range for a line from that in aprevious line exceeds a predetermined value, the difference is limitedto the predetermined value. In order to extract features of a document,three windows for ground, background, and characters are provided in thehistogram and frequencies are calculated for the three windows. It is acharacteristic that background such as a color background on whichcharacters are printed is taken into account besides the ground. Forexample, if a ratio of the frequency for the background to the frequencyfor the ground is small, the ground range is set smaller, while if theratio is large, the ground range is set to be larger. Further, theoffset range is set smaller with decreasing ground peak in order toprevent excess removal of data near the actual ground. Further, if aratio of the frequency for the characters to a sum of the frequenciesfor the ground and the background is larger than a threshold value, thedocument is taken as a half-tone document, and the ground is notremoved.

An advantage of the present invention is that the ground can be removedfast.

Another advantage of the present invention is that the ground can beremoved according to a type of document.

BRIEF DESCRIPTION OF THE DRAWINGS

These and other objects and features of the present invention willbecome clear from the following description taken in conjunction withthe preferred embodiments thereof with reference to the accompanyingdrawings, and in which:

FIG. 1 is a flowchart of image processing on ground;

FIG. 2 is a histogram for illustrating a ground range and variousquantities used to control the ground;

FIGS. 3A-3E are histograms of examples of various types of documents ofa bi-level document, a newspaper document, a magazine document, a mapdocument and a half-tone or photograph document;

FIG. 4 is a histogram for illustrating various quantities used tocontrol the ground;

FIG. 5 is a graph of basic offset quantity H_(b) as a function ofmagazine ratio R_(mg) ;

FIG. 6 is a graph on offset factor C as a function of ground peak x_(p);

FIG. 7 is a diagrammatic view of a digital copying machine;

FIG. 8 is a block diagram of an image processor;

FIG. 9 is a block diagram of a ground controller;

FIG. 10 is a block diagram of a density correction circuit;

FIG. 11 is a diagram on density correction;

FIG. 12 is a main flowchart of ground control;

FIG. 13 is a flowchart of the histogram analysis; and

FIG. 14 is a flowchart of limiting ground quantity.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

Referring now to the drawings, wherein like reference charactersdesignate like or corresponding parts throughout the several views,embodiments of the invention are explained below. In an embodiment ofthe present invention, as shown in FIG. 1, a document is scanned, and alight reflected from a document image is detected with a sensor, such asa linear CCD sensor, and it is converted to digital data of say 256gradation scale for each pixel (step S2). Then, a histogram ofreflectance data of a line or the like is prepared (step S4) where ifnecessary the gradation levels are grouped into 128 sections, eachincluding say two adjacent levels for removing spurious datadistribution. The sections are also called levels herein. FIG. 2 showsan example of a histogram of a document where x₀ denotes black level andx₁₂₇ denotes white. A sharp peak due to a ground appears near themaximum level x₁₂₇, while a broad small peak due to characters (blackimage) appears at low reflectances near zero.

The ground of a document image is removed by using the histogram ofreflectance data on a document. The ground means an area, such as awhite base area in a white paper, wherein no information is recorded.First, a ground peak x_(p), defined as a level having the largestfrequency in the histogram, is determined in a range above apredetermined level x_(b) where the ground is expected to expected toexist (step S6). If there exists a plurality of levels having the samelargest frequency, the one thereof having the smallest level or thesmallest reflectance is selected because it is more appropriate forremoving the ground. Further, quantities which represent features of adocument image are extracted from the histogram (step S8). Then, aground range 2, which is regarded as a range including the ground of thedocument image, is determined by using the ground peak x_(p) and thefeatures (step S8). Then, the data in the ground range 2 are correctedby using the ground range 2, as will be explained later (step S12).

In an example, in order to determine the ground range, an offset H,which represents an extension of the peak due to the ground below thepeak x_(p), is determined. Then, the lower limit x_(r) of the groundrange 2 is determined by subtracting the offset H from the ground peakx_(p). That is,

    x.sub.r =x.sub.p -H.

Thus, the ground quantity R_(th) in reflectance scale is determined asfollows:

    R.sub.th =x.sub.127 -x.sub.r =(x.sub.127 -x.sub.p)+H.

The ground range or R_(th) is determined according to the kind ofdocument by analyzing the histogram. Before explaining the determinationof the ground range, histograms of various types of document areexplained.

FIGS. 3A-3E show examples of histograms of various types of documents. Ahistogram of reflectance data of a document image can be used toclassify various types of documents. In a character or bi-level documentshown in FIG. 3A, black characters are printed on a white paper or on aground. A ground means an area, such as a white base area in a whitepaper, wherein no information is recorded. The ground of the documentconsists of a single peak at or near the white level while data on blackcharacters are sparse and scatter widely at low levels in the histogram.Therefore, the ground can be removed easily at the white side, and thereproduction of characters is most important in image data processing.In a newspaper document shown in FIG. 3B, black characters are printedon a paper which is not so white. No peak appears near the white level,and a broad peak due to the ground exists far from the white level, thatis, the peak of the ground is shifted to a much lower level than thewhite level. The frequency is distributed in a wide range below the peakin the histogram. Therefore, though the ground has to be removed, if itis removed excessively, characters in the document become narrow.

In a magazine document shown in FIG. 3C, characters are printed on acolor background or a color paper. It is a feature of a magazinedocument that a background may be included. The color background is anexample of a background which means an area lying behind chief objectsto be reproduced or a less important part of a document against thechief objects. For example, backgrounds, such as the color background ina magazine document or color areas in a map document, expressinformation relevant to the chief objects to be reproduced or set offthe chief objects. The ground in the magazine document is large anddistributed in a wide range in the histogram, but the frequency in theground range near white is rather large if compared with the newspaperdocument. Characters printed on a color background are hard to be readif the ground is not removed. Therefore, the ground and the backgroundhave to be removed largely. Because the color is also an information tobe reproduced, the background should not be removed completely. Thus,the newspaper document and the magazine document have to be handledaccording to the document type. A map document shown in FIG. 3D includesnarrow color lines. The ground of the map document consists of a singlepeak of almost white, while color data scatter widely below the peak inthe histogram. Then, in order to print narrow color lines, the groundcannot be completely removed. In a half-tone document (a photograph of awoman's face) shown in FIG. 3E, the ground peak is not obvious, and thefrequency distributes in the entire range in the histogram. Then, theground should not be removed.

Document types are classified by using three types of frequencies, thatis, character frequency h_(fw), background frequency h_(bw) and groundfrequency h_(pw) obtained by analyzing a histogram of reflection data ofa document image. The three frequencies are sums of frequencies in threeranges in the histogram explained below, and they are shown in FIGS. 2and 4 as hatched areas. Further, two kinds of ratios, black-to-whiteratio R_(bw) and magazine ratio R_(mg) are defined, and they are alsoused to classify a document type.

As shown in the example shown in FIG. 2 of reflectance of levels x₀ tox₁₂₇, a peak x_(p) of frequency due to ground is observed near white andit is called as ground peak x_(p). FIG. 2 illustrates a relation of theground quantity to an example of the histogram wherein the ordinaterepresents a frequency h_(xi) and the abscissa represents a sectionx_(i) of reflectance defined as follows:

    x.sub.i ={2·i, 2·(i+1)}, i=0-127.

where a representative value of a section is 2·i. In other words,measured reflectance data are grouped for each two data in order toremove spurious scattering of data and there are 128 sections for the256 levels. A first region wherein characters may exist and a second onewherein the ground may exist are defined previously for regions from 0to x_(f) (f<b) and from x_(b) to x₁₂₇, respectively. A characteristicquantity on ground or the ground frequency h_(pw) denotes a sum offrequencies of gradation levels in a first or high window 6 around theground peak x_(p), as shown in FIG. 4 which is an enlarged view of partof FIG. 2. ##EQU1## where pw denotes a value of the width of the window6. The value pw is a fixed value in this example. On the other hand, acharacteristic quantity on characters or the character frequency h_(fw)denotes a sum of frequencies of gradation levels in a third or lowwindow 8 from x₀ to a level x_(f) where characters or black images areexpected to exist, as shown in FIG. 2. ##EQU2## Further, the backgroundfrequency h_(bw) denotes a sum of frequencies of gradation levels in asecond or intermediate window 10 (FIG. 4) from x_(d) to x_(d+bw) locatedbelow the first window 6 where a background is expected to exist.##EQU3##

In the example shown in FIG. 2, x_(d) is located below the ground peakx_(p) by a predetermined constant distance D. The background frequencyh_(bw) intends to detect a background having information such as a colorbackground different from the ground.

Then, the black-to-white ratio R_(bw) and the magazine ratio R_(mg) aredefined as follows:

    R.sub.bw =h.sub.fw /(h.sub.pw +h.sub.bw).

    R.sub.mg =h.sub.bw /h.sub.pw.

If the black-to-white ratio R_(bw) is large, the document is decided tobe a half-tone or photograph document. In this example, if theblack-to-white ratio R_(bw) is larger than a threshold value 35%, thedocument is decided to be a half-tone document, and the ground is notremoved.

For a document where the black-to-white ratio R_(bw) is not larger thanthe threshold value 35%, a ground quantity R_(th) is determined toremove the ground. The ground quantity R_(th) is determined according tothe ground peak x_(p) and a basic offset quantity H_(b), as shown inFIG. 2. The basic offset quantity H_(b) is determined according to themagazine ratio R_(mg) by a relation determined previously by consideringthis situation experimentally. FIG. 5 shows an example of a look-uptable for determining the basic offset quantity H_(b) according to themagazine ratio R_(mg). If the magazine ratio R_(mg) is small, this meansthat the background is small. Then, the basic offset quantity H_(b) in arange from zero to 0.125 is determined for a bi-level document for whichthe ratio R_(mg) is expected small. For a map document, the ratio R_(mg)is small, but larger than a bi-level document. In the example shown inFIG. 5, a range from 0.125 to 0.35 is taken for a map document. Further,in a remaining range above 0.35, a magazine document is expected toexist. Thus, the basic offset quantity H_(b) is changed according to themagazine ratio R_(mg), as shown in FIG. 5, by taking the background andthe ground into account. The magazine ratio R_(mg) is assigned for abi-level document near zero, and the basic offset quantity H_(b) is setto be as low as about 70. For the range assigned for a map document, itis set to be rather low at the center in the range. Further, for therange assigned for a magazine document where the background is large,the basic offset quantity H_(b) is set to be about 95.

As shown in FIG. 6, the basic offset quantity H_(b) determined asexplained above is corrected according to the ground peak x_(p). If theground is removed by using only the offset quantity H_(b), there is atendency that the ground is removed always excessively. If the groundpeak x_(p) is not near the white level x₁₂₇, the document is not abi-level document. A document would have more information near theground peak x_(p) with decreasing ground peak x_(p). The offset factor Cshown in FIG. 6 is determined by considering this situationexperimentally, and an offset factor "C" shown in FIG. 6 is determinedby referring a look-up table. The offset quantity H is determined bymultiplying the offset quantity H_(b) with the offset factor C so as toreduce the degree of the removal of the ground.

As shown in FIG. 6, the offset factor C decreases from 1.0 at x₁₂₇ to0.38 with decreasing ground peak x_(p). Levels near the white levelcorresponds to a bi-level document. Then, lower levels adjacent to thosefor a bi-level document are provided for a map document. On the otherhand, level x₈₄ corresponds to a newspaper document and level x₈₇corresponds to a blue-print document which is not included in theabove-mentioned five types.

FIG. 7 shows a digital copying machine. In an image reader thereof, adocument 20 is put on a platen 22 and it is covered by a cover 24. Afirst slider 26 carries a light source 28 and a first mirror 30, while asecond slider 32 carries second and third mirrors 34, 36. The sliders 26and 32 are driven by a motor 38. A light emitted from the light source28 illuminates the document 20, and the light reflected from thedocument 20 is reflected by the mirrors 30, 34, 36 to enter a lens 40 tofocus onto a light-receiving plane of a linear CCD image sensor 42. In ascan of the document 20, the sliders 26 and 32 are moved by the motor 38in a subscan direction while pixels along a main scan direction in theCCD image sensor 42 are read. Horizontal synchronization signals areused as control signals along the main scan direction, while verticalsynchronization signals are used as control signals along the subscandirection.

The image sensor 42 converts a light signal to an electric signal, whichis amplified by an amplifier 44 and digitalized by an analog-to-digitalconverter 46 to provide digital data of 256 levels. The digital imagesignal is subjected to various processings by an image processor 48. Thedigital data are sent through an interface 50 to a controller 54 of animage forming apparatus such as a digital printer 52 where thecontroller 54 modulates a laser beam according to the corrected imagedata to expose a photoconductor to print an image on a sheet of paperaccording to a known electrophotographic process.

FIG. 8 shows a block diagram of the image processor 48. An image signalreceived from the CCD image sensor 42 is first subjected to an analogprocessing. That is, it is sampled and held by a sample-and-hold circuit62, amplified by an amplifier 62 and converted to a digital value by ananalog-to-digital circuit 64. Then, the digital value of reflectance issubjected to digital processing. The digital value is first correctedfor scatterings due to sensitivity and the like by a shading correctioncircuit 70. Then, it is converted by a reflectance-to-density converter72 to a density data in an appropriate density range. Then, the densitydata are subjected by an MTF correction circuit 74 to edge emphasis andsmoothing in order to improve image quality appropriately for acharacter image and for a half-tone image. Then, the data are enlargedor reduced according to an amplification power by an amplificationsection 76. Finally, the data are corrected as to density by a densitycorrection circuit 78, and the corrected data are sent through aninterface 50 to the printer 52. The blocks 60-76 are known in a digitalcopying machine, while the density correction circuit 78 corrects theimage data according to the ground as explained below.

The image data after shading correction are also stored in a line memory80. The data in the line memory 80 are processed by a ground controller82, which provides signals for ground control to the density correctioncircuit. The ground controller 82 has a central processing unit (notshown) and generates a histogram on the data stored in the line memory122 to determine a ground quantity for each horizontal line, and theground quantity is sent to the density correction circuit 78 insynchronization to a horizontal synchronization signal.

FIG. 9 shows a block diagram of the ground controller 82. Most of theblocks in FIG. 9 are performed by the CPU (not shown) which controls theground controller 82. First, a histogram generation block 100 havingcounters prepares a histogram from the image data of a line stored inthe line memory 80 and sends the histogram data to a memory called ahistogram table 102. Then, by using the histogram data stored in thehistogram table 102, a black-to-white ratio section 104 calculates ablack-to-white ratio R_(bw), and if the ratio R_(bw) is more than 35% ora threshold value, a bi-level section 106 sends a signal for a switch108 to select a standard offset value 110 for data correction withoutground control. If the black-to-white ratio R_(bw) is 35% or less, amagazine ratio section 112 calculates a magazine ratio R_(mg), and alook-up table called an offset table 114, as shown in FIG. 5, sends abasic offset quantity H_(b) according to the ratio R_(mg) by using thehistogram stored in the histogram table 102. On the other hand, a peakvalue detection section 116 detects a ground peak x_(p) from thehistogram and a look-up table called an offset factor table 118, asshown in FIG. 6, sends an offset factor "C" according to the ground peakx_(p). Then, a multiplier 120 multiplies the corrected basic offsetquantity and the offset factor and sends the product to the switch 108.If the black-to-white ratio is less than the threshold value of say 35%,the product is supplied through the switch 108 to the density correctionsection 78.

Next, the density correction by taking ground into account is explained.FIG. 10 shows a block diagram of an example of the density correctionsection 78. In a linear transformation section 200, density dataconverted from reflectance data by the density converter 72 arereceived, and input image density data X are converted linearly to anoutput value Y', as shown in the left-side in FIG. 11, where the groundin the density data exists near the origin.

    Y'=a·X+b,

where b<0. The gradient "a" and the cross point "b" are stored inregisters 202 and 204 by the CPU in the ground controller 82,respectively. Input image data X are multiplied by a multiplier 206 withthe gradient "a" stored in the register 202, and the cross point "b" isadded by an adder 208 to the product. Then, the sum is limited by alimiter 210 for limiting Y' within 256 level.

The value limited by the limiter 210 is supplied to a look-up table 222of 256*8 bits in a nonlinear transformation section 220 for nonlineartransformation. That is, the output value Y' is converted nonlinearlyfor gamma correction by the look-up table 222 as shown in FIG. 11. Afunction for nonlinear transformation in the look-up table 222 isdenoted as f(Y'), where

    Y=f(0),

if

    a·X+b<0,

    Y=f(a·X+b),

if

    0≦a·X+b≦255,

and

    Y=f(255),

if

    255<a·X+b.

As shown in FIG. 11, an output signal Y shown in FIG. 11 is generatedaccording to a density data X.

If

    a=1

and

    f(x)=0 (x=0)

or

    f(x)>0, (x≠0),

a following relation holds between a ground quantity D_(th) and thecross point b:

    1·D.sub.th +b=0.

    b=-D.sub.th.

Therefore, the ground quantity D_(th) can be set only by changing thecross point b by the ground controller 82, without changing the look-uptable 222. If the ground quantity D_(th) is controlled to be decreasedor increased, the ground appears or disappears as shown by an arrow "A"or "B" shown in FIG. 11.

FIG. 12 shows a flow of automatic ground control by the CPU in theground controller 82. First, a histogram is initialized (step S100).Next, a scan is started (step S102) Then, image data of a line is storedin the line memory 80, and a histogram of measured image data isprepared by counting frequencies at a constant sampling time period foreach line or for every few lines by referring to the line memory 80, andthe histogram is stored in the histogram table 102 (step S104). Thesesteps correspond to blocks 100 and 102 in FIG. 9. Then, if it is decidedthat the scan is not a normal scan or it is a prescan (NO at step S106),the flow returns to step S104, so as to perform a normal scan. Adocument is scanned preliminarily first as to an area from an end pointof the document to a point 50 mm therefrom vertically. This prescan isperformed in order to prevent a large change in histogram when a normalscan of the document is started. In a normal scan (YES at step S106),the flow proceeds to step S108 for processing the measured data. In anormal scan for printing, a line in the whole plane of the document isscanned for each line or for every few lines.

In the processing of the measured data, the histogram is analyzed (stepS108) where a ground quantity H is calculated, and the ground quantity His supplied to the density correction section 78 (step S110). Theseprocesses correspond to blocks 104-120 in FIG. 9. Then, if it is decidedthat the scan is not completed (NO at step S112), the flow returns tostep S104, to continue the normal scan, otherwise the flow ends.

FIG. 13 shows a flow of the histogram analysis at step S108. In order toanalyze the histogram, a ground peak x_(p) is first detected (stepS200). It is obtained by searching a section having the largestfrequency in the second region If there is a plurality of second regionsfor determining the largest frequency, the one thereof having thesmallest representative value or the smallest reflectance is selected inorder to remove the ground. Then, the character frequency h_(pw), theground frequency h_(fw) and the background frequency h_(bw) arecalculated (step S202). Then, the black-to-white ratio R_(bw) iscalculated (step S204), and the ratio R_(bw) is compared with athreshold value or 35% (step S206).

If the ratio R_(bw) is smaller than the threshold value or the documentis not a half-tone document, the magazine ratio R_(mg) is calculated(step S208) and a basic offset quantity H_(b) is determined by referringto the offset table 114 (step S210), while the offset factor C isdetermined from the ground peak x_(p) by referring to the offset factortable 118 (step S212). Then, the offset quantity H is calculated as thebasic offset quantity times the offset factor (step S214). Finally, anoffset quantity H is subtracted from the ground peak x_(p) to determinethe lower limit of the ground range x_(r) =x_(p) -H, and the groundquantity R_(th) in reflectance scale is determined as follows:

    R.sub.th =x.sub.127 -x.sub.r =(x.sub.127 -x.sub.p)+H.

On the other hand, if the ratio R_(bw) is equal to or larger than thethreshold value or the document is a half-tone document, a standardvalue of R_(th) is set (step S218) so as to prevent ground correctionfor a half-tone document. The standard value corresponds to a valuewhich is set when a central density is selected in manual exposure modein the digital copying machine.

Then, the ground quantity R_(th) is changed from a value in thereflectance scale to the ground quantity D_(th) in the density scale tobe used in the density correction circuit 78 (step S220). Then, a changeof the ground quantity D_(th) of this line to that of a previous line islimited if necessary (step S222, refer FIG. 14).

FIG. 14 shows a flow of limiting a change in the ground quantity D_(th).First, a change in the ground quantity D_(th) ' of the present line fromthat of previous line is calculated (step S300). Then, an absolute valueof the change in D_(th) from D_(th) ' is compared with a threshold valueor a maximum change R_(max) (step S302). If the absolute value of thechange is equal to or less than the maximum change R_(max), the flowreturns readily. On the contrary, if the absolute value of the changeexceeds the maximum change R_(max) (step S304), the ground quantityR_(th) ' is set as R_(th) -R_(max) (step S306) if the ground quantitydecreases or D_(th) '<D_(th), while if the absolute value of the changeis not larger than the maximum change R_(max) the ground quantity R_(th)' is set as R_(th) +R_(max) (step S308) if the ground quantity increasesor D_(th) '<D_(th). Finally, the ground quantity D_(th) in the presentline is set as D_(th) ' for the processing of the next line (step S310).

In the above-mentioned embodiment, a histogram is prepared for each lineor for every few lines. However, it is also possible to prepare ahistogram for a region larger than a line. In this case, a memory havinga capacity larger than the line memory 80 is provided instead of theline memory, and it stores reflectance data in the region. Then, ahistogram on the region is prepared and the ground is processed in theunit of a region.

Although the present invention has been fully described in connectionwith the preferred embodiments thereof with reference to theaccompanying drawings, it is to be noted that various changes andmodifications are apparent to those skilled in the art. Such changes andmodifications are to be understood as included within the scope of thepresent invention as defined by the appended claims unless they departtherefrom.

What is claimed is:
 1. An image processor comprising:an image readerwhich detects a light reflected from a document and sends gradation dataon the reflected light as digital data for each pixel of an image ofsaid document; a histogram generator for counting frequencies at eachgradation level of the digital data received from said image reader togenerate a histogram; a ground reference setting device for extracting agradation level having the largest frequency in the histogram generatedby said histogram generator to set the extracted gradation level as aground reference value; a first frequency extractor for defining a firstwindow in the histogram as a window including the ground reference valueand for adding frequencies at gradation levels in the first window toprovide a sum of the frequencies in the first window as a firstfrequency; a second frequency extractor for defining a second window inthe histogram as a window existing below the first window in thehistogram, but not including the lowest gradation level and for addingfrequencies at gradation levels in the second window to provide a sum ofthe frequencies in the second window as a second frequency; a featureextractor for determining a ratio of the first frequency provided bysaid first frequency extractor to the second frequency provided by thesecond frequency extractor; a ground range setting device for setting aground range according to the ratio determined by the feature extractorand the ground reference value determined by said ground referencesetting device by using a prescribed relation, which ground rangedenotes a range extending from the largest gradation level in thehistogram; and a data correcting device for correcting the gradationdata provided by said image reader according to the ground range set bysaid ground range setting device.
 2. The image processor according toclaim 1, wherein said histogram generator generates a histogram for eachof a plurality of regions in the document, and said data correctingdevice corrects the gradation data by using the ground range determinedfor each of the plurality of regions.
 3. The image processor accordingto claim 2, wherein each region comprises a line in the document read bysaid image reader.
 4. The image processor according to claim 2, whereinsaid data correcting device comprises a limiting device for calculatinga difference of a ground range set in a region under processing and aground range set in a previously processed region and for limiting theground range as a predetermined largest range if the difference exceedsthe predetermined largest range.
 5. The image processor according toclaim 1, wherein said ground range setting device determines the groundrange as a sum of a ground width determined according to a prescribedrelation to the ratio determined by the feature extractor and the groundreference value set by said ground reference setting device.
 6. Theimage processor according to claim 5, wherein said histogram generatorgenerates a histogram for each of a plurality of regions in thedocument, and said data correcting device corrects the gradation data byusing the ground range determined for each of the plurality of regions.7. The image processor according to claim 5, wherein said ground rangesetting device corrects the ground width according to a predeterminedrelation to the ground reference value set by said ground referencesetting device.
 8. The image processor according to claim 1, whereinsaid data correcting device corrects gradation data in the ground rangeas the lowest gradation level.
 9. The image processor according to claim8, wherein said data correcting device comprises a limiting device forcalculating a difference of a ground range set in a region underprocessing and another ground range set in a previously processed regionand for limiting the ground range as a sum of the another ground rangeand a predetermined value if the difference exceeds the predeterminedvalue.
 10. The image processor according to claim 1, furthercomprising:a third frequency extractor for defining a third window inthe histogram as a window existing below the second window and foradding frequencies at gradation levels in the third window to provide asum of the frequencies in the third window as a third frequency; and aratio determining device for determining a ratio of the third frequencyprovided by said third frequency extractor to a sum of the firstfrequency and the second frequency provided by the first and secondfrequency extractors; wherein said ground range setting device sets theground range as zero if the ratio of the third frequency to the sum ofthe first frequency and the second frequency is larger than apredetermined threshold value.
 11. The image processor according toclaim 1, wherein said data correcting device converts a gradation data Xto an output data Y by using two factors "a" and "b" according to arelation,

    Y=a·X+b,

and corrects the output data for gradation correction, and wherein thefactor b is changed according to the ground range determined by saidground range setting device.
 12. An image processing method comprisingthe steps of:detecting a light reflected from a document and sendinggradation data on the reflected light as digital data for each pixel ofan image of said document; counting frequencies at each gradation levelof the thus sent digital data to generate a histogram; extracting agradation level having the largest frequency in the histogram to set theextracted gradation level as a ground reference value; defining a firstwindow in the histogram as a window including the ground reference valueand adding frequencies at gradation levels in the first window toprovide a sum of the frequencies in the first window as a firstfrequency; defining a second window in the histogram as a windowexisting below the first window, but not including the lowest gradationlevel and for adding frequencies at gradation levels in the secondwindow to provide a sum of the frequencies in the second window as asecond frequency; determining a ratio of the first frequency to thesecond frequency; setting a ground range according to the ratio and theground reference value determined by using a prescribed relation, whichground range denotes a range extending from the largest gradation levelin the histogram; and correcting the gradation data provided by saidstep of detecting according to the ground range.
 13. A digital copyingmachine comprising:an image reader which detects a light reflected froma document and sends gradation data on the reflected light as digitaldata for each pixel of an image of said document; a histogram generatorfor counting frequencies at each gradation level of the digital datareceived from said image reader to generate a histogram; a groundreference setting device for extracting a gradation level having thelargest frequency in the histogram generated by said histogram generatorto set the extracted gradation level as a ground reference value; afirst frequency extractor for defining a first window in the histogramas a window including the ground reference value and for addingfrequencies at gradation levels in the first window to provide a sum ofthe frequencies in the first window as a first frequency; a secondfrequency extractor for defining a second window in the histogram as awindow existing below the first window, but not including the lowestgradation level and for adding frequencies at gradation levels in thesecond window to provide a sum of the frequencies in the second windowas a second frequency; a feature extractor for determining a ratio ofthe first frequency provided by said first frequency extractor to thesecond frequency provided by said second frequency extractor; a groundrange setting device for setting a ground range according to the ratiodetermined by the feature extractor and the ground reference valuedetermined by said ground reference setting device by using a prescribedrelation, which ground range denotes a range extending from the largestgradation level in the histogram; a data correcting device forcorrecting the gradation data provided by said image reader according tothe ground range set by said ground range setting device; and an imageforming device for forming an image on a sheet of paper according to thegradation data corrected by said data correcting device.
 14. The digitalcopying machine according to claim 13, wherein said histogram generatorgenerates a histogram for each of a plurality of regions in thedocument, and said data correcting device corrects the gradation data byusing the ground range determined for each of the plurality of regions.15. The image processor according to claim 13, wherein said datacorrecting device comprises a limiting device for calculating adifference of a ground range set in a region under processing andanother ground range set in a previously processed region and forlimiting the ground range as a sum of the another ground range and apredetermined value if the difference exceeds the predetermined value.16. The image processor according to claim 13, wherein the second windowused to calculate the second frequency is defined according to agradation level lower by a prescribed value than the ground referencevalue.
 17. An image processing method comprising the steps of:detectinga light reflected from a document and sending gradation data on thereflected light as digital data for each pixel of an image of saiddocument; counting frequencies at each gradation level of the thus sentdigital data to generate a histogram; extracting a gradation levelhaving the largest frequency in the histogram to set the extractedgradation level as a ground reference value; defining a first window inthe histogram as a window including the ground reference value andadding frequencies at gradation levels in the first window to provide asum of the frequencies in the first window as a first frequency;defining a second window in the histogram as a window existing below thefirst window, but not including the lowest gradation level and foradding frequencies at gradation levels in the second window to provide asum of the frequencies in the second window as a second frequency;determining a ratio of the first frequency to the second frequency;setting a ground range according to the ratio and the ground referencevalue determined by using a prescribed relation, which ground rangedenotes a range extending from the largest gradation level in thehistogram; correcting the thus sent gradation data according to theground range; and forming an image on a sheet of paper according to thethus corrected gradation data.
 18. An image processor comprising:animage reader which detects a light reflected from a document and sendsgradation data on the reflected light as digital data for each pixel ofan image of said document; a histogram generator for countingfrequencies at each gradation level of the digital data received fromsaid image reader to generate a histogram; a ground reference settingdevice for extracting a gradation level having the largest frequency inthe histogram generated by said histogram generator to set the extractedgradation level as a ground reference value; a ground range settingdevice for setting a ground range according to the ground referencevalue set by said ground reference setting device by using a prescribedrelation, which ground range denotes a range extending from the largestgradation level in the histogram; and a data correcting device forcorrecting the gradation data provided by said image reader according tothe ground range set by said ground range setting device.
 19. The imageprocessor according to claim 18, further comprising a memory for storinggradation data received from the image reader, wherein said histogramgenerator generates the histogram from the data stored in said memory.20. The image processor according to claim 19, wherein said memorycomprises a line memory.
 21. The image processor according to claim 18,further comprising:a first frequency extractor for defining a firstwindow in the histogram as a window including the ground reference valueand for adding frequencies at gradation levels in the first window toprovide a sum of the frequencies in the first window as a firstfrequency; a second frequency extractor for defining a second window inthe histogram as a window existing below the first window, but notincluding the lowest gradation level and for adding frequencies atgradation levels in the second window to provide a sum of thefrequencies in the second window as a second frequency; and a featureextractor for determining a ratio of the first frequency provided bysaid first frequency extractor to the second frequency provided by thesecond frequency extractor; wherein said ground range setting devicesets the ground range according to the ratio determined by said featureextractor and the ground reference value set by the ground range settingdevice.
 22. An image processor comprising:an image reader which detectsa light reflected from a document and sends gradation data on thereflected light as digital data for each pixel of an image of saiddocument; a histogram generator for counting frequencies at eachgradation level of the digital data received from said image reader togenerate a histogram; a ground reference setting device for extracting agradation level having the largest frequency in the histogram generatedby said histogram generator to set the extracted gradation level as aground reference value; a feature extractor for extracting a feature onthe document image from the histogram; a ground range setting device forsetting a ground range according to the ground reference value set bysaid ground reference setting device and the feature extracted by saidfeature extractor by using a prescribed relation, which ground rangedenotes a range extending from the largest gradation level in thehistogram; and a data correcting device for correcting the gradationdata provided by said image reader according to the ground range set bysaid ground range setting device.
 23. The image processor according toclaim 22, wherein said histogram generator generates a histogram foreach of a plurality of regions in the document, and said data correctingdevice corrects the gradation data by using the ground range determinedfor each of the plurality of regions.
 24. The image processor accordingto claim 22, further comprising:a first frequency extractor for defininga first window in the histogram as a window including the groundreference value and for adding frequencies at gradation levels in thefirst window to provide a sum of the frequencies in the first window asa first frequency; and a second frequency extractor for defining asecond window in the histogram as a window existing below the firstwindow, but not including the lowest gradation level and for addingfrequencies at gradation levels in the second window to provide a sum ofthe frequencies in the second window as a second frequency; wherein saidfeature extractor extracts the feature according to the first and secondfrequencies provided by said first and second frequency extractors. 25.The image processor according to claim 22, wherein said data correctingdevice comprises a limiting device for calculating a difference of aground range set in a region under processing and another ground rangeset in a previously processed region and for limiting the ground rangeas a sum of the another ground range and a predetermined value if thedifference exceeds the predetermined value.